//-----------------------------------------------------------------------
// <copyright file="Object_AdessaService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class Object_AdessaService
    {
        #region Object_Adessa

        public static void CreateObject_Adessa(Object_Adessa object_Adessa)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                object_AdessaDAO.CreateObject_Adessa(object_Adessa);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateObject_AdessaException, ex);
            }
        }        

        public static void UpdateObject_Adessa(Object_Adessa object_Adessa)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                object_AdessaDAO.UpdateObject_Adessa(object_Adessa);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateObject_AdessaException, ex);
            }
        }        

        public static void DeleteObject_Adessa(long tGKM_ObjectId)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                object_AdessaDAO.DeleteObject_Adessa(tGKM_ObjectId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteObject_AdessaException, ex);
            }
        }
        
        public static Object_Adessa GetObject_Adessa(long tGKM_ObjectId)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                return object_AdessaDAO.GetObject_Adessa(tGKM_ObjectId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObject_AdessaException, ex);
            }
        }                

        public static Object_AdessaCollection GetObject_AdessaList(Object_AdessaColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                return object_AdessaDAO.GetObject_AdessaList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObject_AdessaListException, ex);
            }
        }        

        public static Object_AdessaCollection GetObject_AdessaList(Object_AdessaColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                return object_AdessaDAO.GetObject_AdessaList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObject_AdessaListException, ex);
            }
        }        

	    public static Object_AdessaCollection GetObject_AdessaListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                return object_AdessaDAO.GetObject_AdessaListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObject_AdessaListException, ex);
            }
        }        

        public static Object_AdessaCollection GetObject_AdessaListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                Object_AdessaDAO object_AdessaDAO = new Object_AdessaDAO();
                return object_AdessaDAO.GetObject_AdessaListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObject_AdessaListException, ex);
            }
        }        

        #endregion
    }
}